package edu.sctu.zhengsenwen.month201506.day20150623.keyword;

/**
 * ?:操作符的作用相当于if-else语句。
 * Created by user15 on 2015/6/23.
 */
public class IfElseDemo {

    public static void main(String[] args) {

        int a = 6;
        int b = 3;
        int c;
        c = a > b ? 1 : 2;
        System.out.println("a = " + a);
        System.out.println("b = " + b);
        System.out.println("c = a > b ? 1:2 , c = " + c);

    }
}
